package com.antcom.antread.common.core.baseRest.domain;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 分页
 *
 * @Author 中国蚂蚁技术有限公司
 * @create 2020/9/6 14:49
 */
public class PageDevice {
    /**
     * 总条数
     */
    private String totalCount;

    /**
     * 当前页数
     */
    private Integer pageNum;

    /**
     * 开始页数
     */
    private String startPageNum = "1";

    /**
     * 每页总条数
     */
    private String pageSize = "30";

    /**
     * 总页数
     */
    private Integer pageTotal;

    /**
     * 分页展示数据
     */
    private List list = new ArrayList();

    /**
     * 排序的map;key为实体类的属性，value为降序desc和升序asc
     * 例如：{"类的属性":"ASC","类的另一个属性":"DESC"}
     */
    private Map<String, String> sortMap;

    /**
     * 查询条件
     * */
    private List<QueryConditions> queryConditions = new ArrayList();

    public Integer getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(Integer pageTotal) {
        this.pageTotal = pageTotal;
    }

    public String getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(String totalCount) {
        this.totalCount = totalCount;
        this.pageTotal = (Integer.parseInt(this.totalCount) - 1) / Integer.parseInt(this.pageSize)+1;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public String getStartPageNum() {
        return startPageNum;
    }

    public void setStartPageNum(String startPageNum) {
        this.startPageNum = startPageNum;
    }

    public String getPageSize() {
        return pageSize;
    }

    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }

    public Map<String, String> getSortMap() {
        return sortMap;
    }

    public void setSortMap(Map<String, String> sortMap) {
        this.sortMap = sortMap;
    }

    public List<QueryConditions> getQueryConditions() {
        return queryConditions;
    }

    public void setQueryConditions(List<QueryConditions> queryConditions) {
        this.queryConditions = queryConditions;
    }
}
